home *** CD-ROM | disk | FTP | other *** search
/ Nautilus 1992 July / Nautilus-3-8 / Nautilus-3-8.bin / Tools & Utilities / Techy Stuff / Doco ƒ / CSMP ƒ / CSMP-V1-082.TXT < prev    next >
Encoding:
Text File  |  1992-06-30  |  41.6 KB  |  1,190 lines

  1. C.S.M.P. Digest             Fri, 15 May 92       Volume 1 : Issue 82
  2.  
  3. Today's Topics:
  4.  
  5.     Think C & 68k cross compiling
  6.     FAQ index ?
  7.     How about powerbook's interrupt&reset KEYS
  8.     How to write a WDEF
  9.     Comparing APPLs and BPPLs
  10.     discipline
  11.     MacTCP - UDPRead aligned?
  12.     Dithering Palette
  13.     How about C.S.M.P on CD-ROM?
  14.     LISP and DrawString questions
  15.     Cdent, where do I find it ?
  16.     Silly question about determining DirIDs
  17.  
  18.  
  19. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  20.  
  21. These digests are available (by using FTP, account anonymous, your email
  22. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  23. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  24. Questions list.  The last several issues of the digest are available from
  25. sumex-aim.stanford.edu as well.
  26.  
  27. These digests are also available via email.  Just send a note saying that you
  28. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  29. automatically receive each new digest as it is created.
  30.  
  31. The digest is a collection of articles from the internet newsgroup comp.sys.
  32. mac.programmer.  It is designed for people who read c.s.m.p. semi-regularly
  33. and want an archive of the discussions.  If you don't know what a newsgroup
  34. is, you probably don't have access to it.  Ask your systems administrator(s)
  35. for details.  (This means you can't post questions to the digest.)
  36.  
  37. The articles in these digests are taken directly from comp.sys.mac.programmer.
  38. They are not edited; all articles included in this digest are in their original
  39. posted form.  The only articles that are -not- included in these digests are
  40. those which didn't receive any replies (except those that give information
  41. rather than ask a question).  All replies to each article are concatenated
  42. onto the original article in the order in which they were received.  Article
  43. threads are not added to the digests until the last article added to the
  44. thread is at least one month old (this is to ensure that the thread is dead
  45. before adding it to the digests).
  46.  
  47. Send administrative mail to mkelly@cs.uoregon.edu.
  48.  
  49. -------------------------------------------------------
  50.  
  51. From: james@ee.uts.edu.au (A. James Boswell)
  52. Subject: Think C & 68k cross compiling
  53. Date: 13 Apr 92 23:41:10 GMT
  54. Organization: University of Technology, Sydney, Australia
  55.  
  56.  
  57. Sorry, this is a repost, cause the title wasn't accurate....
  58.  
  59. Hello,
  60. Can anyone help me with info about compiling for non Mac 68K based
  61. systems using ThinkC 5.0 or a C++ compiler? I own ThinkC 5.0 and I have
  62. to write some code for a 68332 based robot.  (68332 is a superset of
  63. 68K with some 020 instructions).
  64.  
  65. My (many) questions are these :
  66.  
  67. Is there a utility for stripping CODE resources of JUMP tables, and
  68. locating code at a specific address (say for moving code to a ROM)?
  69.  
  70. Is there a way to ensure that no system (OS, ROM or otherwise) code is
  71. called when Think C compiles it?
  72.  
  73. What exactly does A5 point to when a application is first launched ?
  74.  
  75. Could someone explain (in more detail than the manual) the format of
  76. CCOD resources and how I could use them to produce code for a non Mac
  77. target.
  78.  
  79. And finally, is there a C++ (or some object extended C compiler) I can
  80. use with an option for non Mac targets to save mucking around. (And has
  81. anyone ported gnu g++ to a MAC (not AUX) ? I know GNU aren't real fond
  82. of Apple but if its been done that would be fab.)
  83.  
  84. I am planning to use the Mac to download the code to the target, so I
  85. may write an app which loads its own resources, strips its jump table
  86. and spits itself out the serial port. If this is useful to others, I'll
  87. make it PD.
  88.  
  89. All that said (asked) I am doing all this for my undergrad thesis and
  90. there are only 8 weeks left so I really need urgent info. Please help.
  91.  
  92.  
  93. Many thanks,
  94.  
  95.  
  96. A. James Boswell.
  97.  
  98. A. James Boswell                              _--_|\        PO BOX 123
  99. Senior Technical Officer                     /      \       BROADWAY NSW
  100. Computer Systems Group                       \_.--._*       AUSTRALIA 2007
  101. School of Electrical Engineering                   v        FAX: 61 2 330-2435
  102. UNIVERSITY OF TECHNOLOGY, SYDNEY                            PH:  61 2 330-2382
  103.  
  104. +++++++++++++++++++++++++++
  105.  
  106. From: russotto@eng.umd.edu (Matthew T. Russotto)
  107. Date: Tue, 14 Apr 92 15:06:27 GMT
  108. Organization: College of Engineering, University of Maryland, College Park
  109.  
  110. In article <james.703208470@ee.uts.EDU.AU> james@ee.uts.edu.au (A. James Boswell) writes:
  111. >
  112. >Hello,
  113. >Can anyone help me with info about compiling for non Mac 68K based
  114. >systems using ThinkC 5.0 or a C++ compiler? I own ThinkC 5.0 and I have
  115. >to write some code for a 68332 based robot.  (68332 is a superset of
  116. >68K with some 020 instructions).
  117. >
  118. >My (many) questions are these :
  119. >
  120. >Is there a utility for stripping CODE resources of JUMP tables, and
  121. >locating code at a specific address (say for moving code to a ROM)?
  122.  
  123. Under THINK C, compile as a code resource with custom headers-- this
  124. should make pure code, with none of the header stuff.  I'm fairly sure
  125. this will even be loadable to ROM.  THINK C applications are not, as they
  126. use installation code to fix some references.  Don't use any globals--
  127. you will have to handle them yourself.
  128.  
  129. >Is there a way to ensure that no system (OS, ROM or otherwise) code is
  130. >called when Think C compiles it?
  131.  
  132. Don't make any trap calls, and don't include any libraries.  Also,
  133. don't use floating point.  I'm 99% sure that will do it.
  134.  
  135. If you want to use MPW, see Apple tech Note 240-- it has all sorts of
  136. info on the pitfalls of using MPW to make standalone code.
  137. - -- 
  138. Matthew T. Russotto    russotto@eng.umd.edu    russotto@wam.umd.edu
  139. Some news readers expect "Disclaimer:" here.
  140. Just say NO to police searches and seizures.  Make them use force.
  141. (not responsible for bodily harm resulting from following above advice)
  142.  
  143. +++++++++++++++++++++++++++
  144.  
  145. From: aw0g+@andrew.cmu.edu (Aaron Wohl)
  146. Date: 14 Apr 92 08:57:37 GMT
  147. Organization: Special Projects, Carnegie Mellon, Pittsburgh, PA
  148.  
  149. Make a single segment code resource with the custom header checkbox set.
  150.  
  151. It is ok to use globals, but any entry points you will need to to a lea
  152. a4,main to setup the register to point to the globals.  The globals are
  153. mixed in with the code so you might have a problem if the hardware wants
  154. to write protect the code.  You can't take the address of a variable
  155. inside a data declation (eg a staticly initialized array containing
  156. pointers to routines) the compiler will give an error.  Don't load
  157. mactraps or mactraps2.  It is ok to use some of the library routines,
  158. add the .c files one at a time as needed for things like memcpy, ctype.
  159.  
  160. Aaron
  161.  
  162. ---------------------------
  163.  
  164. Subject: FAQ index ?
  165. From: jordi@sc2a.unige.ch
  166. Date: 14 Apr 92 09:59:15 +0200
  167. Organization: University of Geneva, Switzerland
  168.  
  169. Hi !
  170. I would like to know if there is a FAQ index somewhere ?
  171.  
  172. Thanks for any help ....
  173.  
  174. Sincerely,
  175.  
  176. Steve Jordi                
  177.  
  178. +-------------------------+----------------------------------------------+
  179. | Dpt of Geophysics       | Fax: + 41 22 205-732                         |
  180. | University of Geneva    |                                              |
  181. | 13, Rue des Maraichers  | E-Mail: Internet:   jordi@sc2a.unige.ch      |
  182. | 1211 GENEVA 4           |         Bitnet:     jordi@cgeuge52.bitnet    |
  183. | Switzerland             |         Compuserve: 70143,3056 (once a week) |
  184. +-------------------------+----------------------------------------------+ 
  185.  
  186.  
  187. ---------------------------
  188.  
  189. From: michel@cst02.segin.fr (Michel Pollet)
  190. Subject: How about powerbook's interrupt&reset KEYS
  191. Date: 1 Apr 92 23:01:11 GMT
  192. Organization: Groupe Axime
  193.  
  194.  
  195.     Well, nice, all works fine with this pretty PB140, but the
  196.     so used int&reset keys are so little that you have to use a pen
  197.     to push them..
  198.     And no 'power' key, so there no way to uses Programmer's key..
  199.  
  200.     Someone came with a solution ?
  201.  
  202. Michel
  203. - -- 
  204. - -                                 Michel Pollet                               -
  205. - --michel%segin4.segin.fr@relay.prime.com (Office), michel@trantor.uucp (Home)--
  206. - -               Nothing is ever accomplished by a reasonable man.            --
  207.  
  208. +++++++++++++++++++++++++++
  209.  
  210. From: russotto@eng.umd.edu (Matthew T. Russotto)
  211. Date: Thu, 02 Apr 92 18:43:53 GMT
  212. Organization: College of Engineering, University of Maryland, College Park
  213.  
  214. In article <michel.702169271@cst02> michel%cst02.segin.fr@relay.prime.com (Michel Pollet) writes:
  215. >
  216. >    Well, nice, all works fine with this pretty PB140, but the
  217. >    so used int&reset keys are so little that you have to use a pen
  218. >    to push them..
  219. >    And no 'power' key, so there no way to uses Programmer's key..
  220. >
  221. >    Someone came with a solution ?
  222.  
  223. Yes, I modified the code in Programmer's Key which checks for the ROM
  224. code of the Mac Portable, and changed it to check for the ROM code of
  225. the PB170.  You could do the same with the PB140 code.
  226.  
  227. - -- 
  228. Matthew T. Russotto    russotto@eng.umd.edu    russotto@wam.umd.edu
  229. Some news readers expect "Disclaimer:" here.
  230. Just say NO to police searches and seizures.  Make them use force.
  231. (not responsible for bodily harm resulting from following above advice)
  232.  
  233. +++++++++++++++++++++++++++
  234.  
  235. From: ksand@apple.com (Kent Sandvik)
  236. Date: 11 Apr 92 17:06:56 GMT
  237. Organization: MacDTS Mongols
  238.  
  239. In article <1992Apr02.184353.28030@eng.umd.edu>, russotto@eng.umd.edu (Matthew
  240. T. Russotto) writes:
  241. > In article <michel.702169271@cst02> michel%cst02.segin.fr@relay.prime.com
  242. (Michel Pollet) writes:
  243. > >
  244. > >    Well, nice, all works fine with this pretty PB140, but the
  245. > >    so used int&reset keys are so little that you have to use a pen
  246. > >    to push them..
  247. > >    And no 'power' key, so there no way to uses Programmer's key..
  248. > >
  249. > >    Someone came with a solution ?
  250. > Yes, I modified the code in Programmer's Key which checks for the ROM
  251. > code of the Mac Portable, and changed it to check for the ROM code of
  252. > the PB170.  You could do the same with the PB140 code.
  253.  
  254. Programmer's Key 1.4.1 works with powerbooks.
  255.  
  256. Regards,
  257. Kent Sandvik
  258.  
  259. ---------------------------
  260.  
  261. From: mshields@jgravesnext.nurs.utah.edu (Mike Shields)
  262. Subject: How to write a WDEF
  263. Date: 2 Apr 92 21:01:40 GMT
  264. Organization: University of Utah Computer Center
  265.  
  266.  
  267. Can anyone point me in a direction which will give me some help in getting  
  268. going on writing a WDEF.  Is it in IM anywhere.  I'm at work and came up with a  
  269. WDEF I want to do and don't have IM here.  Also, if I wanted to add it to the  
  270. system, ala AltWDEF, how would I go about this??
  271.  
  272. Thanks,
  273. Mike
  274.  
  275. - --
  276. # Mike Shields                   | REPLY TO ->
  277. # Research Assistant             | mshields@peruvian.utah.edu         
  278. # U of Utah. College of Nursing  | mshields@jgravesnext.nurs.utah.edu 
  279. #include <stddisclaimer.h>       | ^^ This one is NeXTmail.
  280.  
  281. +++++++++++++++++++++++++++
  282.  
  283. From: ksand@apple.com (Kent Sandvik)
  284. Date: 11 Apr 92 17:10:52 GMT
  285. Organization: MacDTS Mongols
  286.  
  287. In article <1992Apr2.210140.4369@fcom.cc.utah.edu>,
  288. mshields@jgravesnext.nurs.utah.edu (Mike Shields) writes:
  289. > Can anyone point me in a direction which will give me some help in getting  
  290. > going on writing a WDEF.  Is it in IM anywhere.  I'm at work and came up with
  291. a  
  292. > WDEF I want to do and don't have IM here.  Also, if I wanted to add it to the 
  293.  
  294. > system, ala AltWDEF, how would I go about this??
  295.  
  296. Some information is in the IM, developer CDs have the System 6 WDEF,
  297. and TN 298 talks about the System 7 Window colorization.
  298.  
  299. Also, MacApp has the HyperCard floating window WDEF sources so you could
  300. use those for whatever you want. I guess old MacTutor articles also
  301. talks about WDEF hacking.
  302.  
  303. Regards,
  304. Kent Sandvik
  305.  
  306. ---------------------------
  307.  
  308. From: spud@Apple.COM (Dave "Spud" Kalin)
  309. Subject: Comparing APPLs and BPPLs
  310. Date: 3 Apr 92 23:09:42 GMT
  311. Organization: Apple Computer Inc., Cupertino, CA
  312.  
  313. Someone told me that there is a file type BPPL which denotes a background
  314. application (such as the old Backgrounder).  However, when I use ResEdit to
  315. change an app from APPL to BPPL, the program still runs perfectly, even in
  316. the foreground.
  317.  
  318. So what the heck is a BPPL program, anyway?  Is there any difference
  319. between an APPL and a BPPL?  I can't seem to find any documentation on this
  320. phenomenon anywhere.
  321.  
  322.  
  323. Thanks in advance.
  324.     Dave Kalin
  325.     spud@apple.com
  326.  
  327.  
  328.  
  329. - -- 
  330.  
  331.      *
  332.   *** ***        Dave Kalin (spud@apple.com)
  333.  *******         Apple Computer, Inc.
  334.  *******
  335.   *******        "Changing the world, one layoff at a time."
  336.    ** **
  337.  
  338. +++++++++++++++++++++++++++
  339.  
  340. From: strong@apple.com (Bob Strong)
  341. Date: 13 Apr 92 20:59:11 GMT
  342. Organization: Apple Computer, Inc.
  343.  
  344. In article <64786@apple.Apple.COM>, spud@Apple.COM (Dave "Spud" Kalin) writes:
  345. > Someone told me that there is a file type BPPL which denotes a background
  346. > application (such as the old Backgrounder).
  347.  
  348. Try "appe".
  349.  
  350. +++++++++++++++++++++++++++
  351.  
  352. From: strong@apple.com (Bob Strong)
  353. Date: 13 Apr 92 21:01:22 GMT
  354. Organization: Apple Computer, Inc.
  355.  
  356. In article <64786@apple.Apple.COM>, spud@Apple.COM (Dave "Spud" Kalin) writes:
  357. > Someone told me that there is a file type BPPL which denotes a background
  358. > application (such as the old Backgrounder).
  359.  
  360. Try "appe".
  361.  
  362. ---------------------------
  363.  
  364. From: howard@rigel.cs.pdx.edu (howard l. berkey)
  365. Subject: discipline
  366. Date: 4 Apr 92 18:26:44 GMT
  367.  
  368. Hi!
  369.     What exactly does discipline do for macsbug and where can I get info
  370. on it?
  371.     Thanks in advance,
  372.         -Howard
  373.  
  374.  
  375.  
  376.  
  377. I can't think of anything more politically correct than assasination...:)
  378. Segmentation Fault (core dumped)
  379.  
  380. +++++++++++++++++++++++++++
  381.  
  382. From: ksand@apple.com (Kent Sandvik)
  383. Date: 10 Apr 92 01:37:09 GMT
  384. Organization: MacDTS Mongols
  385.  
  386. In article <5242@pdxgate.UUCP>, howard@rigel.cs.pdx.edu (howard l. berkey)
  387. writes:
  388.  
  389. > Hi!
  390. >     What exactly does discipline do for macsbug and where can I get info
  391. > on it?
  392.  
  393. It's an Apple provided tool which checks parameters sent in and out from
  394. traps, kicking and screaming if they are the wrong ones. It's available
  395. on the ETO CDs and I think it's a product from APDA, but I'm not 100% sure.
  396.  
  397. Cheers,
  398. Kent Sandvik
  399. Dynamic Language, eh, Dynamic Language Maniac
  400.  
  401.  
  402. > I can't think of anything more politically correct than assasination...:)
  403.  
  404. What about castration?
  405.  
  406. +++++++++++++++++++++++++++
  407.  
  408. From: edw@caligula.cts.com (Ed Watkeys)
  409. Date: 10 Apr 92 18:55:09 GMT
  410. Organization: Guerrilla Networking Project
  411.  
  412.  
  413. In article <22811@goofy.Apple.COM> (comp.sys.mac.programmer), ksand@apple.com (Kent Sandvik) writes:
  414. > In article <5242@pdxgate.UUCP>, howard@rigel.cs.pdx.edu (howard l. berkey)
  415. > writes:
  416. >  
  417. > > Hi!
  418. > >     What exactly does discipline do for macsbug and where can I get info
  419. > > on it?
  420. > It's an Apple provided tool which checks parameters sent in and out from
  421. > traps, kicking and screaming if they are the wrong ones. It's available
  422. > on the ETO CDs and I think it's a product from APDA, but I'm not 100% sure.
  423. > Cheers,
  424. > Kent Sandvik
  425.  
  426. Or, you can get it by getting _MacsBug Reference and Debugging Guide_ -- you
  427. can get the book with a floppy that includes MacsBug and Discipline.
  428.  
  429. Ed
  430.  
  431. - --
  432. Ed Watkeys (Drexel U. Comp Sci)  "...if you wish to strive for peace
  433. edw@caligula.cts.com              of soul and pleasure, then believe;
  434. edw%caligula@phlpa.pha.pa.us      if you wish to be a devotee of truth,
  435. ls.com!phlpa!caligula!edw         then inquire...." -- Nietzsche
  436.  
  437. +++++++++++++++++++++++++++
  438.  
  439. From: mhall@occs.cs.oberlin.edu (Matthew Hall)
  440. Organization: Oberlin College Computer Science
  441. Date: Tue, 14 Apr 1992 19:12:56 GMT
  442.  
  443. Hello.
  444.     I have discipline, I know what it does, and I would really
  445. like to use it.  Problem is, it won't let me.  I stick it in my sytem
  446. folder, reboot as normal, (Get debugger installed message for Macsbug,
  447. inits march along the bottom of my screen) and then a funny box comes
  448. up saying 'Discipline - Debugger not installed'  which is rather
  449. curious since 5 seconds ago, my computer told me a debugger was
  450. installed.
  451.     I am running a mac LC, 4 meg, sys 6.0.7  multifinder (though discipline
  452. doesn't work with sys7 on my computer, 32 or 24 bit adressing.  Yes, I
  453. removed sys7 from my computer in an act of defiance) and FPU.  Please
  454. help me.
  455.  
  456. Matthew Hall
  457. - --
  458.  
  459.  
  460. - -------------------------------------------------------------------------------
  461. Matt Hall.    mhall@occs.cs.edu  OR  SMH9666@OBERLIN.BITNET
  462.               (216)-775-5805 (That's a Cleveland Area code. Lucky Me)
  463.  
  464. "If a man comes up to you and says:
  465.     'A dog just carried away your ear.'
  466. Do you run after the dog, or search first for your ear?" - Moon over Morocco
  467.   
  468.  
  469. ---------------------------
  470.  
  471. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  472. Subject: MacTCP - UDPRead aligned?
  473. Organization: University of Illinois at Urbana
  474. Date: Sat, 4 Apr 1992 23:21:23 GMT
  475.  
  476. Another hopefully easy question for the MacTCP programming gods:
  477.  
  478. Am I guaranteed that the data pointed to by the rcvBuff that I get
  479. from a UDPRead call is aligned so that I can do a MOVE.L from it?
  480. Or am I not guaranteed of alignment?
  481.  
  482. Thanks,
  483. pr
  484. - --
  485. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  486. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  487. System manager - Cognitive Science Group, Beckman Institute, UIUC
  488. Internet: resnick@cogsci.uiuc.edu
  489.  
  490. +++++++++++++++++++++++++++
  491.  
  492. From: dorner@pequod.cso.uiuc.edu (Steve Dorner)
  493. Date: 6 Apr 92 14:59:21 GMT
  494. Organization: University of Illinois at Urbana-Champaign
  495.  
  496. resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  497. >Am I guaranteed that the data pointed to by the rcvBuff that I get
  498. >from a UDPRead call is aligned so that I can do a MOVE.L from it?
  499.  
  500. Why not just use BlockMove?  Unless you're going to be doing scads
  501. and scads of little tiny moves, BlockMove will do a fine job, without
  502. compatibility problems.  And you could even get the trap address and
  503. avoid trap overhead, if you want to.
  504. - -- 
  505. Steve Dorner, U of Illinois Computing Services Office
  506. Internet: s-dorner@uiuc.edu  UUCP: uunet!uiucuxc!uiuc.edu!s-dorner
  507.  
  508. +++++++++++++++++++++++++++
  509.  
  510. From: dorner@pequod.cso.uiuc.edu (Steve Dorner)
  511. Date: 6 Apr 92 14:59:21 GMT
  512. Organization: University of Illinois at Urbana-Champaign
  513.  
  514. resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  515. >Am I guaranteed that the data pointed to by the rcvBuff that I get
  516. >from a UDPRead call is aligned so that I can do a MOVE.L from it?
  517.  
  518. Why not just use BlockMove?  Unless you're going to be doing scads
  519. and scads of little tiny moves, BlockMove will do a fine job, without
  520. compatibility problems.  And you could even get the trap address and
  521. avoid trap overhead, if you want to.
  522. - -- 
  523. Steve Dorner, U of Illinois Computing Services Office
  524. Internet: s-dorner@uiuc.edu  UUCP: uunet!uiucuxc!uiuc.edu!s-dorner
  525.  
  526. +++++++++++++++++++++++++++
  527.  
  528. From: tom@wcc.oz.au (Tom Evans)
  529. Date: 10 Apr 92 01:37:12 GMT
  530. Organization: Webster Computer Corp, Melbourne, Australia
  531.  
  532. In article <1992Apr6.145921.26924@ux1.cso.uiuc.edu>, dorner@pequod.cso.uiuc.edu (Steve Dorner) writes:
  533. > resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  534. > >Am I guaranteed that the data pointed to by the rcvBuff that I get
  535. > >from a UDPRead call is aligned so that I can do a MOVE.L from it?
  536.  
  537. Has the block come through a dumb Ethernet card, an A-ROSE Ethernet card,
  538. Token Ring or LocalTalk? Even EtherTalk Phase 1 and EtherTalk Phase 2
  539. are misaligned by one byte (you can have IP-in-MacIP-in-EtherTalk).
  540. You can't tell - don't take the risk.
  541.  
  542. > Why not just use BlockMove?
  543.  
  544. Even something as trivially simple as:
  545.  
  546.     char *p, *q;
  547.     while (n--) 
  548.         *(q++) = *(p++);
  549.  
  550. is faster than BlockMove for n < 50 - even as a subroutine!
  551. Therefore checking for word-alignment and doing long-copies in a
  552. subroutine is going to be faster for n < 200 or so. Using proper
  553. unrolled assembly code is always going to be faster (because that's
  554. what BlockMove() is probably doing).
  555.  
  556. Your mileage may vary.
  557.  
  558. ========================
  559. Tom Evans  tom@wcc.oz.au
  560. Webster Computer Corp P/L, 1270 Ferntree Gully Rd Scoresby, Melbourne 3179
  561. Victoria, Australia 61-3-764-1100  FAX ...764-1179  A.C.N. 004 818 455
  562.  
  563. +++++++++++++++++++++++++++
  564.  
  565. From: dstine@cisco.com (David S.A. Stine)
  566. Date: 12 Apr 92 06:14:45 GMT
  567. Organization: cisco Systems, Menlo Park, California, USA
  568.  
  569. In article <2452@wcc.oz.au> tom@wcc.oz.au (Tom Evans) writes:
  570. >In article <1992Apr6.145921.26924@ux1.cso.uiuc.edu>, dorner@pequod.cso.uiuc.edu (Steve Dorner) writes:
  571. >> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  572. >> Why not just use BlockMove?
  573. >
  574. >Even something as trivially simple as:
  575. >
  576. >    char *p, *q;
  577. >    while (n--) 
  578. >        *(q++) = *(p++);
  579. >
  580. >is faster than BlockMove for n < 50 - even as a subroutine!
  581.  
  582. Yes. A friend did a study of this and came up with a break-even point of about
  583. 32 to 34 bytes for a byte-copy loop, about 50 bytes for an unrolled byte-copy
  584. loop. And by grabbing the address of BlockMove (to avoid trap dispatch
  585. overhead) things got faster still.
  586.  
  587. >Therefore checking for word-alignment and doing long-copies in a
  588. >subroutine is going to be faster for n < 200 or so. Using proper
  589. >unrolled assembly code is always going to be faster (because that's
  590. >what BlockMove() is probably doing).
  591.  
  592. BlockMove does something very close to this. Break out MacNosy to see for
  593. yourself.
  594.  
  595. dsa
  596.  
  597. +++++++++++++++++++++++++++
  598.  
  599. From: Joe.Francis@dartmouth.edu (Joe Francis)
  600. Date: 12 Apr 92 23:01:29 GMT
  601. Organization: Dartmouth College, Hanover, NH
  602.  
  603. In article <2452@wcc.oz.au>
  604. tom@wcc.oz.au (Tom Evans) writes:
  605.  
  606. > ...is faster than BlockMove for n < 50 - even as a subroutine!
  607. > Therefore checking for word-alignment and doing long-copies in a
  608. > subroutine is going to be faster for n < 200 or so. Using proper
  609. > unrolled assembly code is always going to be faster (because that's
  610. > what BlockMove() is probably doing).
  611.  
  612. Don't forget that some macs can execute ROM faster than RAM.
  613.  
  614. +++++++++++++++++++++++++++
  615.  
  616. From: ksand@apple.com (Kent Sandvik)
  617. Date: 11 Apr 92 16:54:54 GMT
  618. Organization: MacDTS Mongols
  619.  
  620. In article <2452@wcc.oz.au>, tom@wcc.oz.au (Tom Evans) writes:
  621. > In article <1992Apr6.145921.26924@ux1.cso.uiuc.edu>,
  622. dorner@pequod.cso.uiuc.edu (Steve Dorner) writes:
  623. > > Why not just use BlockMove?
  624. > Even something as trivially simple as:
  625. >     char *p, *q;
  626. >     while (n--) 
  627. >         *(q++) = *(p++);
  628. > is faster than BlockMove for n < 50 - even as a subroutine!
  629. > Therefore checking for word-alignment and doing long-copies in a
  630. > subroutine is going to be faster for n < 200 or so. Using proper
  631. > unrolled assembly code is always going to be faster (because that's
  632. > what BlockMove() is probably doing).
  633.  
  634. BlockMove is a trap (0xA02E) while the construct above executes directly
  635. in memory. Any code causing a dispatch will always execute slower
  636. than pure RAM resident constructs.
  637.  
  638. Cheers,
  639. Kent Sandvik/DTS
  640.  
  641. ---------------------------
  642.  
  643. From: chaoyang@sal-sun71.usc.edu (Chao Yang)
  644. Subject: Dithering Palette
  645. Date: 5 Apr 92 00:44:26 GMT
  646. Organization: University of Southern California, Los Angeles, CA
  647.  
  648.  
  649. How do you dither a picture without redraw the picture (or painting) again?  Like in C, I use palette manager and color quick draw paint several colors, how do you change certain colors to another specific colors you want without reploting or redrawing?  e.g. all Blue colors --> white colors.  Please indicate what function or routine should I use.  Thanks a lot.
  650.  
  651. +++++++++++++++++++++++++++
  652.  
  653. From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
  654. Date: 13 Apr 92 04:12:51 GMT
  655. Organization: MacDTS, Apple Computer
  656.  
  657. In article <ktsjbaINN9pl@sal-sun71.usc.edu>, chaoyang@sal-sun71.usc.edu (Chao Yang) writes:
  658. > How do you dither a picture without redraw the picture (or painting) again?
  659. > Like in C, I use palette manager and color quick draw paint several colors,
  660. > how do you change certain colors to another specific colors you want without
  661. > reploting or redrawing?  e.g. all Blue colors --> white colors.  Please
  662. > indicate what function or routine should I use.  Thanks a lot.
  663.  
  664. First, in the future please try to insert hard carriage returns so your post
  665. will wrap onto multiple lines, for those of us using news readers which require
  666. this.
  667.  
  668. What you want to do is called palette animation; on an indexed device (1-8
  669. bits, 2-256 colors) it allows you to instantly change an index from one color
  670. to another, changing all the instances of that color on the screen.  It's
  671. a little too complex to describe well in this message, so I'll refer you to
  672. Inside Macintosh; IM V,pg 156, or IM VI, pg 20-10 should get you started;
  673. best of luck.
  674.  
  675. Tim Dierks
  676. MacDTS, but not nearly as Ren & Stimpy mad as Kent.
  677.  
  678. ---------------------------
  679.  
  680. Organization: Queen's University at Kingston
  681. Date: Sunday, 5 Apr 1992 23:29:52 EDT
  682. From: <CHARLESW@QUCDN.QueensU.CA>
  683. Subject: How about C.S.M.P on CD-ROM?
  684.  
  685.   Like many people who follow CSMP I keep my own little archives of things
  686. I think will be useful some day--bits of code, bugs and pitfalls, and corres-
  687. pondence on all those things I hope to have time to delve into some day.
  688. And, whenever I run into an area I'm struggling over, I scan the last year or
  689. so of my archives using Gopher.  Often I find useful things.  Of course 90%
  690. of what I save probably never gets used, but who can tell in advance.
  691.  
  692.   Has anyone proposed making CSMP available periodically on CD-ROM, say with
  693. On Location index files?  I'm assuming, of course, that CSMP is essentially
  694. a large community conversation where all participants are aware that their
  695. comments are broadcast, and so moving the notes to a different medium wouldn't
  696. require copyright releases from everyone who even said "This is a test...".
  697. CD-ROM production prices are reasonable, CD-ROM players are becoming plentiful
  698. (now that I have one :-), and the overhead might be low enough for it to fly.
  699.  
  700.   What do people think?  Would a semi-annual CD-ROM be worth ten or fifteen
  701. bucks or would it already be too stale?
  702.  
  703. .../Dave   Dave Charlesworth
  704.  
  705. +++++++++++++++++++++++++++
  706.  
  707. From: pasek@npdiss1.StPaul.NCR.COM (Michael A. Pasek)
  708. Date: 7 Apr 92 16:18:53 GMT
  709. Organization: NCR NPG - St. Paul
  710.  
  711. In article <92096.232952CHARLESW@QUCDN.QueensU.CA> CHARLESW@QUCDN.QueensU.CA writes:
  712. >[some stuff deleted]
  713. >  Has anyone proposed making CSMP available periodically on CD-ROM, say with
  714. >On Location index files?  [more stuff deleted]
  715. >  What do people think?  Would a semi-annual CD-ROM be worth ten or fifteen
  716. >bucks or would it already be too stale?
  717.  
  718. I think this would be an excellent idea, but rather than just a compendium of
  719. C.S.M.P. as it appeared on USENET, why not have the articles grouped by 
  720. subject (ala C.S.M.P. Digest) ?
  721.  
  722. On the other hand, there is already a company that is planning to issue CD-ROMs
  723. containing _all_ USENET news.  It's called NetNews/CD, and they are supposed
  724. to start shipping CD-ROMs in ISO9660 format (with a Mac reader) sometime this
  725. month.
  726.  
  727. Personally, I'd probably prefer one that had _only_ C.S.M.P., with probably
  728. some of the other Mac-specific newsgroups (e.g., c.s.m.system, c.s.m.hardware,
  729. comp.protocols.appletalk, etc.).
  730.  
  731. M. A. Pasek                 Software Support                    NCR NPG 
  732. (612) 638-7668            Development  Support            2700 N. Snelling Ave.
  733. pasek@ncrons.StPaul.NCR.COM                               Roseville, MN  55113
  734.  
  735. +++++++++++++++++++++++++++
  736.  
  737. From: kent@sparky.imd.sterling.com (Kent Landfield)
  738. Date: 8 Apr 92 21:53:19 GMT
  739. Organization: Sterling Software
  740.  
  741. In article <1417@npdiss1.StPaul.NCR.COM> pasek@ncrons.StPaul.NCR.COM (Mike Pasek) writes:
  742. >In article <92096.232952CHARLESW@QUCDN.QueensU.CA> CHARLESW@QUCDN.QueensU.CA writes:
  743. >>[some stuff deleted]
  744. >>  Has anyone proposed making CSMP available periodically on CD-ROM, say with
  745. >>On Location index files?  [more stuff deleted]
  746. >>  What do people think?  Would a semi-annual CD-ROM be worth ten or fifteen
  747. >>bucks or would it already be too stale?
  748.  
  749. If you think that you can pay for all your production costs selling a CD-ROM
  750. for ten or fifteen bucks, I will be in line to buy one... :-) 
  751.  
  752. >On the other hand, there is already a company that is planning to issue CD-ROMs
  753. >containing _all_ USENET news.  It's called NetNews/CD, and they are supposed
  754. >to start shipping CD-ROMs in ISO9660 format (with a Mac reader) sometime this
  755. >month.
  756.  
  757. Sterling Software has been shipping USENET News on CD-ROM since the first of 
  758. the year in Sun UFS format.  We are in the final stages of preparation for 
  759. producing an ISO 9660 format version.  (News doesn't fit real well into the
  760. ISO 9660 format...)  The Mac reader is a problem in that the only version with 
  761. sources we have been able to aquire is NewsWatcher. It has limitations in
  762. that it uses the list manager for displaying newsgroups. Newswatcher can't 
  763. handle the 1800 to 2500 newsgroups which are on the CD-ROMs each issue... :-(
  764. We are trying to work around it but it has not been as easy a process as it 
  765. initially appeared.  (It never is...) Because of that we do not expect to be
  766. shipping a Mac reader until May.  If someone has other Mac readers for which 
  767. they can supply sources please contact me and maybe we can speed up the
  768. availability of the Mac readers.
  769.  
  770. >Personally, I'd probably prefer one that had _only_ C.S.M.P., with probably
  771. >some of the other Mac-specific newsgroups (e.g., c.s.m.system, c.s.m.hardware,
  772. >comp.protocols.appletalk, etc.).
  773.  
  774. We are planning on producing specialized yearly series CD-ROMs.  The Mac 
  775. groups were one we had considered.  If you are interested in seeing us do 
  776. that please send email to cdnews@sterling.com and let us know.
  777.  
  778. More information on the service and its directions can be found by sending
  779. email to cdnews@sterling.com or via anonymous ftp from ftp.uu.net in the 
  780. directory ~/vendors/sterling.
  781.  
  782.             -Kent+
  783. - ---
  784. Kent Landfield                   INTERNET: kent@IMD.Sterling.COM
  785. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  786. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  787. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  788.  
  789. +++++++++++++++++++++++++++
  790.  
  791. From: caruso@gbi01.enet.dec.com (Angelo Caruso)
  792. Date: 9 Apr 92 22:51:39 GMT
  793. Organization: Digital Equipment Corporation
  794.  
  795.  
  796. In article <92096.232952CHARLESW@QUCDN.QueensU.CA>, <CHARLESW@QUCDN.QueensU.CA> writes...
  797. >  Like many people who follow CSMP I keep my own little archives of things
  798. >I think will be useful some day--bits of code, bugs and pitfalls, and corres-
  799. >pondence on all those things I hope to have time to delve into some day.
  800. >And, whenever I run into an area I'm struggling over, I scan the last year or
  801. >so of my archives using Gopher.  Often I find useful things.  Of course 90%
  802. >of what I save probably never gets used, but who can tell in advance.
  803. >  Has anyone proposed making CSMP available periodically on CD-ROM, say with
  804. >On Location index files?  I'm assuming, of course, that CSMP is essentially
  805. >a large community conversation where all participants are aware that their
  806. >comments are broadcast, and so moving the notes to a different medium wouldn't
  807. >require copyright releases from everyone who even said "This is a test...".
  808. >CD-ROM production prices are reasonable, CD-ROM players are becoming plentiful
  809. >(now that I have one :-), and the overhead might be low enough for it to fly.
  810. >  What do people think?  Would a semi-annual CD-ROM be worth ten or fifteen
  811. >bucks or would it already be too stale?
  812. >..../Dave   Dave Charlesworth
  813.  
  814. I'd subscribe to it immediately !!!
  815.  
  816. Angelo.
  817.  
  818. +++++++++++++++++++++++++++
  819.  
  820. From: ksand@apple.com (Kent Sandvik)
  821. Date: 14 Apr 92 19:16:23 GMT
  822. Organization: MacDTS Mongols
  823.  
  824. In article <1417@npdiss1.StPaul.NCR.COM>, pasek@npdiss1.StPaul.NCR.COM (Michael
  825. A. Pasek) writes:
  826. > Personally, I'd probably prefer one that had _only_ C.S.M.P., with probably
  827. > some of the other Mac-specific newsgroups (e.g., c.s.m.system, c.s.m.hardware,
  828. > comp.protocols.appletalk, etc.).
  829.  
  830. Another issue would be a form of intelligent editing of the contents, so
  831. we would have a better format for browsing and searching. It's a huge task,
  832. though.
  833.  
  834. Cheers,
  835. Kent
  836.  
  837. ---------------------------
  838.  
  839. Subject: LISP and DrawString questions
  840. From: myers@wittenberg.edu
  841. Date: 6 Apr 92 12:35:23 -0400
  842. Organization: Wittenberg University
  843.  
  844. I asked both of these questions before but I never received any answers because
  845. the newsfeed here went down for 5 days and we missed all those messages.
  846.  
  847. First:  I'm looking for a public domain version of LISP.  Does anybody know of
  848. one (if so, where can I get hold of it)?
  849.  
  850. Second: I want to draw white text on a black background and everything I
  851. display using DrawString just appears as black (which is no good since that is
  852. the same color as the background!).  I've tried changing the PenPat, but that
  853. doesn't work.
  854.  
  855. Thanks!
  856.  
  857. Altan Stalker
  858. Wittenberg University
  859. MYERS@WITTENBERG.EDU
  860.  
  861. +++++++++++++++++++++++++++
  862.  
  863. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  864. Organization: Kalamazoo College
  865. Date: Tue, 7 Apr 1992 14:44:04 GMT
  866.  
  867. myers@wittenberg.edu writes:
  868. >
  869. >First:  I'm looking for a public domain version of LISP.  Does anybody know of
  870. >one (if so, where can I get hold of it)?
  871.  
  872. Is this on the FAQ list?  Eric Sink posted a list of free/shareware
  873. compilers a while back;  I think that belongs in the FAQ.
  874.  
  875. I don't know of a LISP, but there's a decent Scheme at
  876. sumex-aim.stanford.edu.
  877.  
  878. >Second: I want to draw white text on a black background and everything I
  879. >display using DrawString just appears as black (which is no good since that is
  880. >the same color as the background!).  I've tried changing the PenPat, but that
  881. >doesn't work.
  882.  
  883. There are two schools of thought, I believe.  The first method is to
  884. change the PenPat and make sure you're using TextMode(srcCopy).  The
  885. default mode is srcOr, and or'ing white won't do a thing.  The second is
  886. to draw in TextFace(outline), again with srcCopy.  There really isn't
  887. any reason to do the second (unless you're sloppy and are likely to
  888. forget to change the PenPat back to something reasonable), but it's a
  889. handy trick to know when you're using stupid graphics programs that
  890. won't let you do text white-on-black.
  891. - -- 
  892.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  893.  "Almost all portables today employ passive-matrix LCDs, and no one expects
  894.  active-matrix screens to be cost-competitive for a few years" -PC World 2/92
  895.  
  896. +++++++++++++++++++++++++++
  897.  
  898. From: d88-jwa@byse.nada.kth.se (Jon W{tte)
  899. Organization: Royal Institute of Technology, Stockholm, Sweden
  900. Date: Tue, 7 Apr 1992 19:21:04 GMT
  901.  
  902. .edu> myers@wittenberg.edu writes:
  903.  
  904.    First:  I'm looking for a public domain version of LISP.  Does anybody
  905.    know of one (if so, where can I get hold of it)?
  906.  
  907. There's a nice LISP called "SIOD" short for Scheme In One Defun. Check
  908. for it with archie.
  909.  
  910.    Second: I want to draw white text on a black background and everything I
  911.    display using DrawString just appears as black (which is no good since
  912.    that is the same color as the background!).  I've tried changing the
  913.    PenPat, but that doesn't work.
  914.  
  915. Text drawing uses CopyBits; you'd have to use a TextMode ( patXor ) or
  916. TextMode ( patBic )
  917.  
  918. - -- 
  919. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  920.  
  921. +++++++++++++++++++++++++++
  922.  
  923. From: d88-jwa@byse.nada.kth.se (Jon W{tte)
  924. Organization: Royal Institute of Technology, Stockholm, Sweden
  925. Date: Tue, 7 Apr 1992 19:22:22 GMT
  926.  
  927.  
  928. .edu> myers@wittenberg.edu writes:
  929.  
  930.    First:  I'm looking for a public domain version of LISP.  Does anybody
  931.    know of one (if so, where can I get hold of it)?
  932.  
  933. There's a nice LISP called "SIOD" short for Scheme In One Defun. Check
  934. for it with archie.
  935.  
  936.    Second: I want to draw white text on a black background and everything I
  937.    display using DrawString just appears as black (which is no good since
  938.    that is the same color as the background!).  I've tried changing the
  939.    PenPat, but that doesn't work.
  940.  
  941. Text drawing uses CopyBits; you'd have to use a TextMode ( srcXor ) or
  942.                                ^^^^^^
  943. TextMode ( srcBic )
  944.            ^^^^^^
  945.  
  946. I made an error... using patXxx where srcXxx is appropriate is a
  947. good way of making things invisible on SEs and earlier machines.
  948.  
  949.  
  950. - -- 
  951. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  952.  
  953. +++++++++++++++++++++++++++
  954.  
  955. From: ksand@apple.com (Kent Sandvik)
  956. Date: 14 Apr 92 19:24:43 GMT
  957. Organization: MacDTS Mongols
  958.  
  959. In article <1992Apr6.123523.1@wittenberg.edu>, myers@wittenberg.edu writes:
  960. > I asked both of these questions before but I never received any answers
  961. because
  962. > the newsfeed here went down for 5 days and we missed all those messages.
  963. > First:  I'm looking for a public domain version of LISP.  Does anybody know of
  964. > one (if so, where can I get hold of it)?
  965.  
  966. Check comp.lang.lisp now and then for their FAQ, it should have a list of 
  967. known PD LISP systems running under MacOS, including ftp addresses.
  968.  
  969. As for PD stuff, there are few (any?) Common Lisps which are free that I know
  970. of. Our Common Lisp implementation, MCL, costs 495$US, and it's a bargain
  971. compared with what you get, CLOS, Mac libraries, most of the stuff you need
  972. in the LISP world. Similar Windows packages are usually 5000$US upwards
  973. (development environment).
  974.  
  975. Cheers,
  976. Kent Sandvik
  977. Dynamic Language Believer
  978.  
  979. ---------------------------
  980.  
  981. From: louis@asterix.drev.dnd.ca (Louis Demers)
  982. Subject: Cdent, where do I find it ?
  983. Date: 7 Apr 92 13:58:14 GMT
  984. Organization: Defence Research Establishment Valcartier
  985.  
  986. Hi,
  987.  
  988.     In the documentation of MPW, there a references to a shell variable
  989. that contains the options for a C++ beautifier.  How can I get this
  990. beautifier ?
  991.  
  992.         Louis
  993. - -- 
  994. | Louis Demers              | DREV, Defence Research Establishment,Valcartier |
  995. | louis@asterix.drev.dnd.ca | POBox 8800, Courcelette,Quebec, CANADA, G0A 1R0 |
  996. |            (131.132.48.2) | Office: (418) 844-4424       fax (418) 844-4511 |
  997. +---------------------------+-------------------------------------------------+
  998.  
  999. +++++++++++++++++++++++++++
  1000.  
  1001. From: ksand@apple.com (Kent Sandvik)
  1002. Date: 14 Apr 92 19:29:14 GMT
  1003. Organization: MacDTS Mongols
  1004.  
  1005. In article <1992Apr7.135814.10598@asterix.drev.dnd.ca>,
  1006. louis@asterix.drev.dnd.ca (Louis Demers) writes:
  1007. > Hi,
  1008. >     In the documentation of MPW, there a references to a shell variable
  1009. > that contains the options for a C++ beautifier.  How can I get this
  1010. > beautifier ?
  1011.  
  1012. What I know it's one of the few *Apple internal* tools, so we can't 
  1013. release it. I guess I could ask if we could send it out as an alpha
  1014. tool.
  1015.  
  1016. Cheers,
  1017. Kent
  1018. PS: Yes, I'm nowadays using it a lot from MPW, makes my ugly indentation
  1019. look better.
  1020.  
  1021. ---------------------------
  1022.  
  1023. From: gerson@parc.xerox.com (Dan Gerson)
  1024. Subject: Silly question about determining DirIDs
  1025. Date: 8 Apr 92 23:18:21 GMT
  1026. Organization: Xerox PARC, Palo Alto, CA
  1027.  
  1028. This seems like it should be obvious, so I'm afraid that I'm asking a
  1029. stupid question, but how do you find out the DirID of a directory?
  1030.  
  1031. In particular, I have an alias record to a directory which I've extracted
  1032. from a database.  I then resolve the alias into an FSSpec, and then want
  1033. to create new files in the named directory.  I assumed that the best way
  1034. to do this was to call FSMakeFSSpec for the VRefNum,DirID,and new file name,
  1035. followed by an FSpCreate.  However, I can't seem to figure out how to
  1036. get the DirID given an FSSpec.
  1037.  
  1038. I tried (in C++ MacApp code where fAlias is an AliasHandle):
  1039.  
  1040.     OSErr err;
  1041.     FSSpec dirspec;
  1042.     Boolean changed;
  1043.     err = ResolveAlias(NULL,fAlias,dirspec,changed);
  1044.     FailOSErr(err); // To simplify the example...
  1045.  
  1046.     HParamBlockRec info;
  1047.     CStr255 name = dirspec.name;
  1048.     info.fileParam.ioCompletion = NULL;
  1049.     info.fileParam.ioNamePtr = name;
  1050.     info.fileParam.ioVRefNum = dirspec.vRefNum;
  1051.     info.fileParam.ioFDirIndex = 0;
  1052.     info.fileParam.ioDirID = dirspec.parID;
  1053.     info.fileParam.ioFVersNum = 0; // Just for grins
  1054.     err = PBHGetFInfo(&info,FALSE);
  1055.     FailOSErr(err);
  1056.     fDirID = info.fileParam.ioDirID;
  1057.  
  1058. but fDirID is always the DirID of the aliases parent, not of the named
  1059. directory.
  1060.  
  1061. Just for completeness, in case the problem is actually with the
  1062. alias itself, it was created with:
  1063.  
  1064.     OSErr err;
  1065.     FSSpec dirspec;
  1066.     err = FSMakeFSSpec(NULL,NULL,"Oracle:ClipBin:",&dirspec);
  1067.     FailOSErr(err);
  1068.  
  1069.     // Get an alias record to the bin's directory
  1070.     AliasHandle alias;
  1071.     err = NewAlias(NULL,dirspec,alias);
  1072.     FailOSErr(err);
  1073.     FailNIL(alias);            // Not sure if this is necessary
  1074.     fAlias = alias;
  1075.  
  1076. What am I doing wrong?  I'm more interested in what's the right way to
  1077. accomplish my higher level goal (of storing alias records to directories
  1078. in some database which I can later use to specify where I should create
  1079. data files (in particular QuickTime movies)).
  1080.  
  1081. Thanks.
  1082. - --
  1083.  
  1084. Dan Gerson                    gerson@parc.xerox.com
  1085. Xerox Palo Alto Research Center            415-494-4745
  1086. 3333 Coyote Hill Road
  1087. Palo Alto, CA 94304
  1088. USA
  1089.  
  1090. +++++++++++++++++++++++++++
  1091.  
  1092. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  1093. Date: 9 Apr 92 20:47:49 GMT
  1094. Organization: Royal Institute of Technology, Stockholm, Sweden
  1095.  
  1096. .xerox.com> gerson@parc.xerox.com (Dan Gerson) writes:
  1097.  
  1098.    This seems like it should be obvious, so I'm afraid that I'm asking a
  1099.    stupid question, but how do you find out the DirID of a directory?
  1100.  
  1101.        HParamBlockRec info;
  1102.        CStr255 name = dirspec.name;
  1103.  
  1104. You can't copy strings this way in C...
  1105.  
  1106. Three weeks ago I posted these, and here we go again:
  1107.  
  1108.  
  1109. long
  1110. GetDirID ( FSSpec * fss )
  1111. {
  1112.     CInfoPBRec pb ;
  1113.  
  1114.     BlockClear ( & pb , sizeof ( pb ) ) ;
  1115.     pb . dirInfo . ioVRefNum = fss -> vRefNum ;
  1116.     pb . dirInfo . ioDrDirID = fss -> parID ;
  1117.     pb . dirInfo . ioNamePtr = fss -> name ;
  1118.     FailOSErr ( PBGetCatInfo ( & pb , 0 ) ) ;
  1119.  
  1120.     ASSERT ( pb . hFileInfo . ioFlAttrib & 0x10 ) ;
  1121.     return pb . dirInfo . ioDrDirID ;
  1122. }
  1123.  
  1124.  
  1125. OSErr
  1126. GetDirName ( short vol , long dir , unsigned char * name )
  1127. {
  1128.     CInfoPBRec pb ;
  1129.  
  1130.     BlockClear ( & pb , sizeof ( pb ) ) ;
  1131.     pb . hFileInfo . ioFDirIndex = -1 ;
  1132.     pb . hFileInfo . ioDirID = dir ;
  1133.     pb . hFileInfo . ioVRefNum = vol ;
  1134.     pb . hFileInfo . ioNamePtr = name ;
  1135.  
  1136.     return PBGetCatInfo ( & pb , 0 ) ;
  1137. }
  1138. - -- 
  1139. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  1140.  
  1141. +++++++++++++++++++++++++++
  1142.  
  1143. From: dn5@apix.psu.edu (D. Jay Newman)
  1144. Date: 10 Apr 92 20:50:15 GMT
  1145. Organization: Penn State
  1146.  
  1147. In article <D88-JWA.92Apr9214749@hemul.nada.kth.se>, d88-jwa@hemul.nada.kth.se (Jon W{tte) writes:
  1148. > .xerox.com> gerson@parc.xerox.com (Dan Gerson) writes:
  1149. >        HParamBlockRec info;
  1150. >        CStr255 name = dirspec.name;
  1151. > You can't copy strings this way in C...
  1152.  
  1153. Sorry, Jon, but while you can't copy strings in C that way, you can copy
  1154. them in C++ using the CStr255 class (which is defined in some MacApp headers).
  1155.  
  1156. I think that they will eventually be part of the normal MPW C++ distribution.
  1157. They certainly make *my* life easier.
  1158.  
  1159. ()()()()()()()()()()()()() CBEL--Teaching & Learning Technologies ()()()
  1160. D. Jay Newman     !            Save the whales
  1161. dn5@psuvm.psu.edu !        (Collect the whole set)
  1162. dn5@apix.psu.edu  !
  1163.  
  1164. ---------------------------
  1165.  
  1166. End of C.S.M.P. Digest
  1167. **********************
  1168.